<?php
declare(strict_types=1);
namespace App\Service\Goods\Order;
use App\Models\Goods\Order;
class OrderShow implements OrderShowInterface {
    public function index($request){
        return Order::query()
            // 使用 with 方法预加载，避免N + 1问题
            ->with(['items.product', 'items.productSku'])
            ->where('user_id', $request->user()->id)
            ->orderBy('created_at', 'desc')
            ->paginate();
    }

}
